﻿//==============================================================================  
//Copyright (C) 2012-2015 9UN.ORG. All rights reserved. 
//GUID：46172595-6b69-4526-b9da-426d663f5b05
//CLR Version: 4.0.30319.18033
//Code Author：Kevin Wang
//Contact：Email(Admin@9un.org),QQ(265382 or 74344)
//Filename：DoubleWindowBase
//Namespace：RuanRang.Media.Core
//Functions：DoubleWindowBase  
//Created by Kevin Wang at 2013/2/2 23:05:09 http://blog.9un.org
//============================================================================== 

#region Usings

using System;
using RuanRang.Media.Core.Io;

#endregion

namespace RuanRang.Media.Core
{
    /// <summary>
    /// Provides logic for VLC library to allow
    /// changing video streams on the fly.
    /// </summary>
    public abstract class DoubleWindowBase : MediaWindow
    {
        /// <summary>
        /// Gets or sets a value indicating whether [player visible internal].
        /// </summary>
        /// <value><c>true</c> if [player visible internal]; otherwise, <c>false</c>.</value>
        internal bool PlayerVisibleInternal
        {
            get
            {
                return (PlayerVisible);
            }
            set
            {
                var visible = value;
                if (PlayerVisible != visible)
                {
                    PlayerVisible = value;
                }
            }
        }

        /// <summary>
        /// Player visibility.
        /// </summary>
        protected abstract bool PlayerVisible
        {
            get;
            set;
        }

        /// <summary>
        /// Returns handle to first window handle.
        /// </summary>
        /// <returns>OS specific handle of window.</returns>
        protected abstract IntPtr GetActiveWindowHandle();

        /// <summary>
        /// Returns handle to second window handle.
        /// </summary>
        /// <returns>OS specific handle of window.</returns>
        protected abstract IntPtr GetInactiveWindowHandle();

        /// <summary>
        /// Provides logic to switch between two windows.
        /// </summary>
        protected abstract void SwitchWindows();

        /// <summary>
        /// For internal library calls.
        /// </summary>
        internal IntPtr GetActiveWindowHandleInternal()
        {
            return (GetActiveWindowHandle());
        }

        /// <summary>
        /// For internal library calls.
        /// </summary>
        internal IntPtr GetInactiveWindowHandleInternal()
        {
            return (GetInactiveWindowHandle());
        }

        /// <summary>
        /// For internal library calls.
        /// </summary>
        internal void SwitchWindowsInternal()
        {
            SwitchWindows();
        }
    }
}